package com.netcracker.util.dao;

import com.netcracker.db.DBManager;
import com.netcracker.db.exception.DBException;
import com.netcracker.entity.Book;
import com.netcracker.entity.record.BookRecord;
import java.io.File;
import java.io.IOException;
import java.util.List;

public interface BookDAO {

    public void setDBManager(DBManager dbManager);
    
    public void setDAOFacade(DAOFacade daoFacade);
    
    public void create(BookRecord book) throws DBException, IOException;

    public void edit(BookRecord book) throws DBException;

    public void remove(int bookID) throws DBException;

    public Book find(int bookID) throws DBException;

    public List<Book> findAll() throws DBException;

    public int count() throws DBException;
    
    public List<Book> findByAuthor(int authorID) throws DBException;
    
    public List<Book> findByGenre(int genreID) throws DBException;
    
    public List<Book> findByPublisher(int publisherID) throws DBException;
    
    public List<Book> findByUser(int userID) throws DBException;
    
    public List<Book> findByName(String name) throws DBException;
    
    public File findBookImage(int bookID) throws DBException, IOException;
    
    public File findBookFile(int bookID) throws DBException, IOException;
    
}
